package com.my.core.base.response;

import java.io.Serializable;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;

public class APIResponse implements Serializable{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 657310689781380036L;
	
	private Boolean success;
	
	/**
	 * api返回码
	 */
	private String code;
	/**
	 * api返回消息
	 */
	private String msg;
	
	private Object data;
	
	
	
	public APIResponse() {
		this(null,null, null,null);
	}
	public APIResponse(Boolean success) {
		this(success,null, null,null);
	}
	
	public APIResponse(Boolean success,String msg) {
		this(success,null, msg,null);
	}

	public APIResponse(Boolean success,String code,String msg) {
		this(success,code, msg,null);
	}
	
	public APIResponse(Boolean success, Object t) {
		this(success,null, null,t);
	}
	
	public APIResponse(Boolean success, String code, String msg,Object t) {
		super();
		this.success = success;
		this.code = code;
		this.msg = msg;
	}
	
	

	public Boolean getSuccess() {
		return success;
	}

	public void setSuccess(Boolean success) {
		this.success = success;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	@Override
	public String toString() {
		return JSON.toJSONString(this, SerializerFeature.UseISO8601DateFormat);
	}
}
